<template>
  <div class="menu">
    <div :class="type === 'big'?'menuItem':'menuItemS'" v-for="(item, index) in list" :key="index" @click="navTo(item.url)">
      <img :src="item.src" />
      <span>{{ item.name }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'MenuList',
  props: {
    type: String,
    list: Array
  },
  methods: {
    navTo(path) {
      this.$router.push(path)
    }
  }
}
</script>

<style scoped>
.menu {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  justify-content: left;
  margin: 12px 12px 0 12px;
}

.menuItem {
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}
.menuItem img {
  width: 53px;
}
.menuItemS {
  width: 20%;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}
.menuItemS img {
  width: 33px;
}
</style>
